# 通过下标获取特定位置字符
name = "itheima"
print(name[0])
print(name[-1])

#
print(name.index('he'))

# 替换
new_name = name.replace("i", "小美")
print(name)
print(new_name)

# 字符串分割
name = "小美 小帅 小明 小花"
name_list = name.split(" ")
print(name_list)
print(type(name_list))

# 去前后空格
my_str = " itheima and itcast "
print(my_str.strip())
# 去前后指定字符串
my_str = "12itheima and itcast21"
print(my_str.strip("12"))
print(my_str.count("it"))
num = my_str.strip("12")
print(len(num))
